package com.rockxin.cat.adapter;

import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.view.View;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.animation.GlideAnimation;
import com.bumptech.glide.request.target.ImageViewTarget;
import com.bumptech.glide.request.target.SimpleTarget;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.rockxin.cat.R;
import com.rockxin.cat.bean.ChooseBankCardBean;

import java.util.List;

/**
 * <b>类名称：    ChooseBankCardAdapter             <br/>
 * <b>类描述：                        <br/>
 * <b>创建人：    Lans               <br/>
 * <b>创建时间：  2018/3/3 09:28     <br/>
 * <b>修改人：                        <br/>
 * <b>修改时间：                      <br/>
 * <b>修改备注：                      <br/>
 *
 * @version 1.0.0 <br/>
 */
public class ChooseBankCardAdapter extends BaseQuickAdapter<ChooseBankCardBean, BaseViewHolder> {
    private List<ChooseBankCardBean> mData;

    public ChooseBankCardAdapter(@Nullable List<ChooseBankCardBean> data) {
        super(R.layout.dialog_choose_bank_card_item, data);
        this.mData = data;
    }

    @Override
    protected void convert(BaseViewHolder helper, final ChooseBankCardBean item) {
        final TextView name = helper.getView(R.id.name);
        name.setText(item.getName());
        if (item.isChoose()) {
            name.setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, ContextCompat.getDrawable(mContext, R.mipmap.filled_circle), null);
        } else {
            name.setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, ContextCompat.getDrawable(mContext, R.mipmap.circle), null);
        }
    }
}
